package check1_5;

public class Rectangle extends Shape {
	//定义两个属性 n(底) m(高)
	private float n;
	private float m;
	
	/**
	 * 实现Shape求面积的方法
	 */
	@Override
	public float calArea() {
		// 矩形面积公式 S=底*高
		return n*m;
	}

	public float getN() {
		return n;
	}

	public void setN(float n) {
		this.n = n;
	}

	public float getM() {
		return m;
	}

	public void setM(float m) {
		this.m = m;
	}

	@Override
	public String toString() {
		return String.valueOf("矩形面积为"+n*m);
	}
}
